<?php
require_once('include/GeneralTop.php');
require('include/class/db.php');
$db = new db;

$sql = "select member_id from member_info";
$query = $db->query($sql);
while($row = $db->fetch($query)) {
	$seed = uniqid();
	$token = md5($seed);
	$db->query("update member_info set unsubscribe_token='".$token."' where member_id='".$row['member_id']."'");
}

$sql = "select ECId from emailcollection";
$query = $db->query($sql);
while($row = $db->fetch($query)) {
	$seed = uniqid();
	$token = md5($seed);
	$db->query("update emailcollection set unsubscribe_token='".$token."' where ECId='".$row['ECId']."'");
}

/*
$sql = "select member_id from member_info";
$query = $db->query($sql);
while($row = $db->fetch($query)) {
	$seed = uniqid();
	$token = md5($seed);
	$db->query("update member_info set unsubscribe_token='".$token."' where member_id='".$row['member_id']."'");
}
*/
?>